<template>
  <div class="multiple_box">
    <el-select
      v-model="multipleData"
      filterable
      multiple
      collapse-tags
      collapse-tags-tooltip
      :placeholder="`请选择${placehText}，可多选`"
      @change="changeData"
      :clearable="clearable"
    >
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
        <span style="float: left">{{ item.label }}</span>
        <span style="float: right">
          <el-tag v-if="item.value && item?.appType === 'dy'">
            {{ "抖音" }}
          </el-tag>
        </span>
      </el-option>
    </el-select>
  </div>
</template>

//
<script lang="ts" setup>
import { ref } from "vue";

const multipleData = ref<Array<any>>([]);

const props = defineProps({
  options: {
    type: Array<any>,
  },
  placehText: {
    type: String,
    default: "剧集",
  },
  clearable: {
    type: Boolean,
    default: true,
  },
});

// 修改时间;
const emit = defineEmits(["selectChange"]);
const changeData = (val: any) => {
  emit("selectChange", val);
};

defineExpose({
  multipleData,
});
</script>
//
